<?php

namespace app\model;

use app\model\setting\LIMIT;

class RepairModel extends \think\Model
{
    protected $table = "报修";
    protected $pk = "requestId";

    public function insertRepairs($repairs): int
    {
        return $this->limit(LIMIT::$LIMITFORSQL)->insertAll($repairs);
    }

    public function deleteRepairs($ids): bool
    {
        return self::destroy($ids);
    }

    public function getAllRepairs()
    {
        return self::select();
    }

    public function updateRepairs($repairs)
    {
        //更新每一个报修
        foreach ($repairs as $key => $value)
            self::update($value);// == "";
    }
}